#导包
from rest_framework import serializers
#导入数据库类
from myapp.models import User,Category,Course,Comment,Flows,Codes,Orders

#定义序列化类
class UserSer(serializers.ModelSerializer):
    class Meta:
        model = User
        #声明字段
        fields = "__all__"

class CategorySer(serializers.ModelSerializer):
    class Meta:
        model = Category
        #声明字段
        fields = "__all__"


class CourseSer(serializers.ModelSerializer):
    class Meta:
        model = Course
        #声明字段
        fields = "__all__"

class CommentSer(serializers.ModelSerializer):
    class Meta:
        model = Comment
        #声明字段
        fields = "__all__"

class FlowsSer(serializers.ModelSerializer):
    class Meta:
        model = Flows
        #声明字段
        fields = "__all__"

class CodesSer(serializers.ModelSerializer):
    class Meta:
        model = Codes
        #声明字段
        fields = "__all__"
        
class OrdersSer(serializers.ModelSerializer):
    class Meta:
        model = Orders
        #声明字段
        fields = "__all__"